import 'package:architecture/os_size.dart';
import 'package:dropdown_text_field/dropdown_text_field.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/base/BaseController.dart';
import 'package:study_demo/widgets/drop_down_text.dart';
import 'package:study_demo/widgets/gradient_circular_progress_indicator.dart';

import '../../../widgets/circle_progress_bar.dart';
import '../../../widgets/count_down_text_button.dart';
import '../../../widgets/title_container.dart';
import 'custom_widget_hall_controller.dart';

class CustomWidgetHallPage extends StatelessWidget {
  final List<FlSpot> scatterData = [
    FlSpot(1, 2),
    FlSpot(3, 4),
    FlSpot(5, 3),
    FlSpot(7, 6),
    FlSpot(9, 5),
  ];

  @override
  Widget build(BuildContext context) {
    return GetBuilder<CustomWidgetHallController>(
        init: CustomWidgetHallController(),
        builder: (controller) {
          return Scaffold(
              appBar: AppBar(title: Text('自定义组件')),
              body: Container(
                padding: EdgeInsets.all(15),
                width: windowWidth,
                height: windowHeight,
                color: Colors.white,
                child: Wrap(
                    alignment: WrapAlignment.start,
                    crossAxisAlignment: WrapCrossAlignment.start,
                    spacing: 20,
                    runSpacing: 20,
                    children: [
                      Row(
                        children: [
                          Text(
                            "DropDownTextField:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          DropDownTextField(
                            width: 150,
                            height: 35,
                            controller: controller.secondController,
                            list: seconds.toList(),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "DropDownText:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          DropDownText(
                            width: 150,
                            height: 35,
                            msg: '10',
                            list: seconds.toList(),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "CountDownTextButton:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          CountDownTextButton(
                            text: '同意',
                            count: 30,
                            width: 100,
                            height: 35,
                            onPressed: () {
                              toast('同意');
                            },
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "GradientCircularProgressIndicator:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          GradientCircularProgressIndicator(
                            value: 0.8,
                            colors: [
                              Colors.lightGreenAccent,
                              Colors.lightGreen
                            ],
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "CircleProgressBar:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          CircleProgressBar(
                            text: '8G',
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "TextBg:",
                            style: TextStyle(color: Colors.deepPurpleAccent),
                          ),
                          TitleContainer(
                            label: '统计',
                            // textStyle: TextStyle(color: Colors.red),
                            // strokeWidth: 2,
                            // borderColor: Colors.blue,
                          ),
                        ],
                      )
                    ]),
              ));
        });
  }

  _scatterPlot() {}
}
